//
// Created by chizuru on 2025/9/2.
//

#pragma once
#include "IDeviceIO.h"
#include "IConfigurable.h"
#include <iostream>
#include <vector>

class PxdSerialAdapter : public IDeviceIO , public IConfigurable{
public:
    PxdSerialAdapter(int unit);

    int configure(std::any baud, std::any dataBits, std::any parity, std::any stopBits, std::any flowctrl) override ;

    int write(const char* data, size_t size) override ;

    int read( char* buf, size_t maxSize) override ;

    int flushReadAndWrite() override;
private:
    int unit;
};

